1. Field of the Invention
The present invention relates to a print control apparatus that generates data for print output by performing a decompression process on compressed data.
2. Description of Background Art
Conventionally, there is known a printing system configured by a printing apparatus such as an inkjet printing apparatus; and a host (typically, a computer called a “server”) which is a transmission source of print data. In such a printing system, when comparing the data transfer rate between the host and the printing apparatus with the printing speed of the printing apparatus, generally, the printing speed of the printing apparatus is higher. Therefore, when image data to be printed is transmitted to the printing apparatus from the host as it is, the printing apparatus cannot perform printing at its original printing speed (the printing apparatus needs to stop printing at times). Hence, when performing printing, compressed image data is transmitted to the printing apparatus from the host.
FIG. 11 is a diagram schematically showing the flow of data when an inkjet printing apparatus performs printing. When performing printing, first, image data to be printed is compressed by a host. Then, the compressed data is transmitted to a print control apparatus in the inkjet printing apparatus from the host. The compressed data is temporarily stored in a memory in the print control apparatus. Thereafter, the print control apparatus reads the compressed data from the memory and performs the process of decompressing the read compressed data. Then, the decompressed data is transmitted to a print head unit of a printer main body, and print output (printing on print paper) is performed.
However, when there is an error in compressed data which is read from the memory, decompression of the data cannot be correctly performed. Note that the causes of the error in compressed data include, for example, memory failure, malfunction due to noise or the like, and data loss in a data transmission path between the host and the print control apparatus. When the printing apparatus prints a large amount of pages, if only certain density data (pixel value data) included in compressed data is not correctly decompressed, only printed matter of a page including the density data results in a defect (print failure). However, if an error occurs in post-decompression data size for a certain page, printed matter of all pages after the page results in a defect. For example, when print output of images such as those shown in FIG. 12A are to be performed originally, if the post-decompression data size is smaller than the original one, printing results are such as those shown in, for example, FIG. 12B. In this example, printed matter of all three pages results in a defect.
As a method for handling an error such as that described above, there is a method (hereinafter, referred to as a “first conventional technique”) in which an error in a decompression process is detected by counting the number of decompressed data (e.g., the number of bytes) and comparing a value obtained by the counting with an expected value (a post-decompression data size which is notified in advance to the printing apparatus from the host). However, since the print control apparatus performs pipeline processing for a higher processing speed, a decompressing unit that performs a decompression process is continually given compressed data that does not include page break information, as shown in FIG. 13. Hence, even when a decompression process is performed on compressed data shown in, for example, FIG. 13, a distinction cannot be made between a decompression result for the first page and a decompression result for the second page. Therefore, an error in decompression process can be detected only after obtaining a post-decompression data size for all page, i.e., after completing print output of all pages. Hence, print output cannot be stopped at the time of the occurrence of an error in decompression process, resulting in waste of print paper and ink.
In view of this, there is considered a method (hereinafter, referred to as a “second conventional technique”) in which reading of compressed data is performed on a page-by-page basis and a post-decompression data size (hereinafter, referred to as a “decompressed size”) is checked each time a decompression process of compressed data for one page is completed. A processing procedure of the second conventional technique will be described below with reference to a flowchart shown in FIG. 14. Note that this process is performed by a print control apparatus. First, a receiving unit in the print control apparatus receives compressed data transmitted from a host (step S90). In addition, aside from the compressed data, information on a decompressed size for each page is transmitted from the host. The receiving unit notifies a checking unit of the decompressed sizes (step S91). Then, the compressed data is written to a memory (step S92). When compressed data of a certain fixed value is written to the memory, a reading unit in the print control apparatus reads the compressed data from the memory and transfers the read compressed data to a decompressing unit (step S93). Note that, in the second conventional technique, the compressed data includes break data including information on the size of compressed data (hereinafter, referred to as a “compressed size”) for each page. Based on the information on the compressed sizes, compressed data is transferred on a page-by-page basis to the decompressing unit from the reading unit. When the compressed data is transferred to the decompressing unit, the decompressing unit performs a decompression process (step S94). During a period in which the decompression process is performed, the decompressing unit turns on a decompression flag which is a flag indicating whether a decompression process is performed, and the checking unit counts the period in which the decompression flag is turned on. When the decompression process is completed, the decompression flag is turned off, and the checking unit checks whether the decompression process has been correctly performed (step S95). This check is performed by comparing a value obtained by the counting with a value of a corresponding decompressed size which is notified in step S91. As a result of the check, when the values match, it is determined that “the decompression process has been correctly performed”, and when the values do not match, it is determined that “the decompression process has not been correctly performed”. When the decompression process has been correctly performed, processing returns to step S93, and reading of compressed data for the next page from the memory is performed. On the other hand, when the decompression process has not been correctly performed, an error process such as stopping print output is performed (step S96). In the above-described manner, whether a decompression process is correctly performed can be checked on a page-by-page basis.
Note that, in connection with this invention, JP 03-196760 A and JP 04-265057 A describe that break marks (break data) indicating breaks between pages are added to data to be transmitted and received. In addition, JP 05-49020 A describes that information indicating the length of compressed data is included in a break code of the compressed data.
However, according to the second conventional technique, during a period after reading compressed data for a certain page from the memory until a check of a decompression result for the page is completed, compressed data for the next page cannot be read from the memory. Hence, the printing apparatus cannot perform printing at its original printing speed. In addition, according to the first conventional technique, as described above, print output cannot be stopped at the time of the occurrence of an error in decompression process, resulting in waste of print paper and ink.